breaking the records hackerrank solution in c